package com.cn.service.Impl;

import com.cn.utils.MenuTreeBuilder;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cn.mapper.SysMenuMapper;
import com.cn.pojo.SysMenu;
import com.cn.service.SysMenuService;
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService{

    //    查询菜单树
    @Override
    public List<SysMenu> findMenuTree() {
        List<SysMenu> rootMenu=this.baseMapper.selectList(null);
        List<SysMenu> menuList= MenuTreeBuilder.build(rootMenu);
        return menuList;
    }

}
